<template>
  <div class="not-found">
    <h1>404 - 页面未找到</h1>

    <img
      :src="imageSrc"
      alt="404 Not Found"
      class="not-found-image"
    />

    <router-link
      to="/"
      class="back-home"
    >
      返回首页
    </router-link>
  </div>
</template>

<script setup lang="ts">
const imageSrc = new URL('@/assets/404.png', import.meta.url).href
</script>

<style scoped>
.not-found {
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.not-found h1 {
  font-size: 2em;
  margin-bottom: 20px;
}

.not-found p {
  font-size: 1.2em;
  margin-bottom: 30px;
}

.not-found-image {
  max-width: 300px;
  height: auto;
  margin-bottom: 30px;
}

.back-home {
  display: inline-block;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}

.back-home:hover {
  background-color: #0056b3;
}
</style>
